package com.liutao.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.liutao.entity.Talents;
import com.liutao.entity.Title;

public interface TalentsDao {
	//用于模糊查询职称
	@Select("select * from week3_title")
	List<Title> findTitleNames();

	List<Talents> list(Talents talents);

	void add(Talents talents);
	
	@Insert("insert into week3_talents_title set talent_id=#{id},title_id=#{tid}")
	void addCenter(@Param("id")Integer id, @Param("tid")Integer tid);
	
	@Select("select * from week3_talents where id = #{id}")
	Talents findById(@Param("id")Integer id);

	
	@Select("select title_id from week3_talents_title where talent_id = #{id}")
	Integer[] findCenterById(@Param("id")Integer id);
	
	@Delete("delete from week3_talents_title where talent_id = #{id}")
	void delCenter(@Param("id")Integer id);
	
			
	@Update("update week3_talents set taname=#{taname},birthday=#{birthday},gender=#{gender},phone=#{phone},specialty=#{specialty},institution=#{institution} where id = #{id}")
	void update(Talents talents);
	
	@Delete("delete from week3_talents where id =#{id}")
	void delTalents(@Param("id")Integer id);

}
